package com.siam.package_util.controller.member;

import com.siam.package_common.entity.BasicResult;
import com.siam.package_order.feign.OrderFeignApi;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping(value = "/rest/scheduledTaskExecutor")
@Transactional(rollbackFor = Exception.class)
public class ScheduledTaskExecutorController {

    @Autowired
    private OrderFeignApi orderFeignApi;

    /**
     * 每天凌晨0点15分解冻订单相关冻结资金
     * @return
     */
    @PostMapping(value = "/unfreezePayOrderFrozenBalance")
    public BasicResult unfreezePayOrderFrozenBalance(){
        orderFeignApi.unfreezePayOrderFrozenBalance();
        return BasicResult.success();
    }
}